
from Interface.IFileIconProvider import IFileIconProvider
import clr
clr.AddReference("../Dll/DllHelper")
from DLLHelper import DLLHelper
class WinFileIconProvider(IFileIconProvider):
    def __init__(self, filePath):
        self.__filePath = filePath
    def getFileIcon(self,sizeflag):
        '''
        :param sizeflag:
         LARGE: 0
         SMALL: 1
         EXTRALARGE: 2
         SYSSMALL: 3
         JUMBO：4
         控制返回图标的大小，一般情况下4比较清晰
        :return: 返回base64编码的图片数据
        '''
        if sizeflag not in list(range(0,5)):
            raise Exception("sizeflag参数需要是0-4之间的整数")
        return DLLHelper().GetIconFromFile(self.__filePath, sizeflag)